package com.zhangye.test.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import com.zhangye.test.model.Admin;
import com.zhangye.test.service.IndexService;

@Controller
@RequestMapping("index")
public class IndexController {
	
	@Autowired
	private IndexService indexService;

	@RequestMapping("/list")
	public String list(Model model){
		List<Admin> list = indexService.selectAll();
		model.addAttribute("adminList",list);
		
		return "main";
	}
}
